var __extends =
    (this && this.__extends) ||
    (function () {
      var t = function (i, n) {
        return (t =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (t, i) {
              t.__proto__ = i;
            }) ||
          function (t, i) {
            for (var n in i)
              Object.prototype.hasOwnProperty.call(i, n) && (t[n] = i[n]);
          })(i, n);
      };
      return function (i, n) {
        function e() {
          this.constructor = i;
        }
        if ("function" != typeof n && null !== n)
          throw new TypeError(
            "Class extends value " + String(n) + " is not a constructor or null"
          );
        t(i, n),
          (i.prototype =
            null === n
              ? Object.create(n)
              : ((e.prototype = n.prototype), new e()));
      };
    })(),
  MyCustomSliderView = (function (t) {
    function i() {
      var i = t.call(this) || this;
      return (
        (i.max = 50),
        (i.min = 1),
        (i.step = 1),
        (i.num = 1),
        i.btn_slider_add.on(Laya.Event.CLICK, i, i.onUserActionPlusDidClick),
        i.btn_slider_delete.on(Laya.Event.CLICK, i, i.onUserActionPlusDidClick),
        i.slider_myCustom.on(Laya.Event.CHANGE, i, i.sliderChange),
        i
      );
    }
    return (
      __extends(i, t),
      (i.showCustomSliderView = function (t, n, e, s) {
        return (
          null == this.mySlider && (this.mySlider = new i()),
          (this.mySlider.slider_myCustom.max = n),
          (this.mySlider.max = n),
          (this.mySlider.min = t),
          (this.mySlider.caller = e),
          (this.mySlider.method = s),
          this.mySlider
        );
      }),
      (i.prototype.onUserActionPlusDidClick = function (t) {
        "item0" == t.target.name
          ? ((this.num = this.num - this.step),
            this.num < this.min && (this.num = this.min),
            (this.slider_myCustom.value = this.num))
          : ((this.num = this.num + this.step),
            this.num > this.max && (this.num = this.max),
            (this.slider_myCustom.value = this.num)),
          this.method.call(this.caller, this.num);
      }),
      (i.prototype.sliderChange = function () {
        (this.num = this.slider_myCustom.value),
          this.method.call(this.caller, this.num);
      }),
      i
    );
  })(ui.common.MyCustomSliderViewUI);
